package com.atguigu.day14.test12;

/**
 * @author fenge
 */
public class Test12 {
    public static void main(String[] args) {
        String str = "1、 hello 2. world 3. java 4.String 5. haha 6、HELLO";
//        char[] ch = new char[]{'a', 'l', 'f', 'm', 'f', 'o', 'b', 'b', 's', 'n'};
        char[] ascii = new char[62];
        for (int index = 0; index < 10; index++)
            ascii[index] = (char) ('0' + index);
        for (int index = 0; index < 26; index++)
            ascii[index + 10] = (char) ('a' + index);
        for (int index = 0; index < 26; index++)
            ascii[index + 36] = (char) ('A' + index);
//        System.out.println(Arrays.toString(ascii));
        int[] count = new int[62];
        for (int i = 0; i < str.length(); i++) {
            for (int j = 0; j < ascii.length; j++) {
                if (str.charAt(i) == ascii[j]) {
                    count[j]++;
                }
            }
        }
        for (int i = 0; i < ascii.length; i++) {
            if (count[i] != 0)
                System.out.println(ascii[i] + "--" + count[i]);
        }
    }
}
